<?php
//$username = $_POST['p'];//获取索引值
//define('SBDOCKER','sbdocker');
//$con = mysqli_connect('localhost','hand','hand');
//$sel=mysqli_select_db('mymess');
//$sql='select * from mess';
//$res=mysqli_query($sql);
//if (!$res) {
//    die("could get the res:\n" . mysql_error());
//}
//while ($row = mysqli_fetch_assoc($res)) {
//    echo $row;
//}

//echo 'hello!';
//phpinfo();
//


$mysqli = new mysqli("localhost", "srp", "srp", "mymess");


//if(!$mysqli)  {
//    echo"database error";
//}else{
//    echo"php env successful";
//}
//$sql = 'select * from mess';
//$res = mysqli_query($mysqli, $sql);
//echo $res;

//$arr = mysqli_fetch_array($res);
//printf($arr);

$ip=$_POST['ip'];
$city=$_POST['city'];
$text=$_POST['mess'];
$add_sql="insert into mess(ip,city,text,time) value('$ip','$city','$text',sysdate())";
//echo $add_sql;

$res = mysqli_query($mysqli, $add_sql);
echo $res;



$mysqli->close();

//echo $username;


?>